#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
void Reverse(char str[], int i, int j)
{
	while (i < j)
	{
		char tmp = str[i];
		str[i] = str[j];
		str[j] = tmp;
		i++;
		j--;
	}
}
void Func(char str[], int k)
{
	int len = strlen(str);
	int time = k % len;
	Reverse(str, 0, time - 1);
	Reverse(str, time, len - 1);
	Reverse(str, 0, len - 1);
}
int main()
{
	char str[] = "abcd";
	Func(str, 3);
	printf("%s\n", str);
	return 0;
}